import React from 'react'
import {Outlet,useNavigate} from 'react-router-dom'
export default function Home() {
    const Navigate = useNavigate()
    const changeNews = () =>{
        Navigate("/main/home/news/001/?user=陈凌文&id=250",{
          state : [
            {id:'001',name:'黄渤'},
            {id:'002',name:'王宝强'},
            {id:'003',name:'黄晓明'},
          ]
        }

        )
    }
    const changeHobby = () => {
        Navigate("/main/home/hobby/002/?user=陈凌文&id=250",{
          state: [
            { id: "001", name: "空间站国旗与地球同框" },
            { id: "002", name: "罗永浩谈钟薛高卖得贵" },
            { id: "003", name: "麦当劳员工将掉地上面包放回货架" },
          ]
        })
    }
  return (
    <div>
        <h3>我是Home的内容</h3>
        <button onClick={changeNews}>News</button>
        <button onClick={changeHobby}>Hobby</button>
        <Outlet/>
    </div>
  )
}
